# Contributor: Michał Polański <michal@polanski.me>
# Maintainer: Michał Polański <michal@polanski.me>
pkgname=py3-poetry-plugin-export
pkgver=1.6.0
pkgrel=1
pkgdesc="Poetry plugin to export the dependencies to various formats"
url="https://github.com/python-poetry/poetry-plugin-export"
license="MIT"
arch="noarch"
# This plugin depends on poetry, but poetry depends on it as well.
# Poetry is therefore not listed to avoid a cyclic dependecy.
# See: https://github.com/python-poetry/poetry/pull/5980
makedepends="py3-gpep517 py3-installer py3-poetry-core"
checkdepends="py3-pytest py3-pytest-mock"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/python-poetry/poetry-plugin-export/archive/$pkgver.tar.gz
	pytest.patch
	"
builddir="$srcdir/poetry-plugin-export-$pkgver"
options="!check" # cyclic dependency on poetry

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
9ea155a2f80b63c0ed7261615041048f0afdacbb21a6c0618cf4174cc76b2c10ac3102eb7325fda760d6cfac0e95b9194b2f16c33395c88dffcea9ddfaf0ac65  py3-poetry-plugin-export-1.6.0.tar.gz
1bad78c40d1647b32bd2d111179f7f44195c0e606a24f26b87c4ebf3cc05730659a3ebe9ffcf09f9e698ac0421c8f90de58038940f41963bea93be610edc7e41  pytest.patch
"
